program integer_division
    integer, parameter :: dp = kind(0.0d0)
    integer :: n
    n = 3
    print *, n / 2  ! prints 1
    print *, n*(n + 1)/2  ! prints 6
    print *, n/2*(n + 1)  ! prints 4 (left-to-right evaluation order)
    n = -3
    print *, n / 2  ! prints -1
    n = 3
    print *, real(n, dp) / 2  ! prints 1.5
    print *, n * 1.0_dp / 2  ! prints 1.5
    n = -3
    print *, real(n, dp) / 2  ! prints -1.5
    print *, n * 1.0_dp / 2  ! prints -1.5
end program integer_division